﻿@model XRM.Security.WebUI.Models.Request.RequestCloseModel
@{
    ViewBag.Title = Model.RequestId.HasValue ? "Закрытие заявки" : "Закрытие работы";
    Layout = "~/Views/Shared/_LayoutDialog.cshtml";
}

@using (Html.BeginForm("CloseDialog", "Request", FormMethod.Post, new { id = "dlgCloseDialogForm" }))
{
    <div class="modal-body form-inline">
        @Html.AntiForgeryToken()
        @Html.HiddenFor(m => m.RequestId)
        @Html.HiddenFor(m => m.RequestWorkKindId)
        
        <div class="form-group">
            <label class="control-label required">Дата закрытия</label>
            @Html.EditorFor(m => m.CloseDate)
            <div>
                @Html.ValidationMessageFor(m => m.CloseDate)
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="submit" class="btn btn-primary">Сохранить</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">Отмена</button>
    </div>
}

<script type="text/javascript">
    $(function () {
        initDatepicker();
        $("#CloseDate").datepicker('option', 'maxDate', new Date());
    });
</script>
